import { StackScreenProps } from "@react-navigation/stack"
import React, { FC } from "react"
import { TouchableOpacity } from "react-native"
import { Text, View } from "../../components/Themed"
import { RootStackParamList } from "../../types"
import styles from "./styles"
/**
 * 404页面
 */
type Props = StackScreenProps<RootStackParamList, "NotFound">

const NotFoundScreen: FC<Props> = (props: Props) => {
  const { navigation } = props

  return (
    <View style={styles.container}>
      <Text style={styles.title}>This screen doesn't exist.</Text>
      <TouchableOpacity
        onPress={() => navigation.replace("Root")}
        style={styles.link}
      >
        <Text style={styles.linkText}>Go to home screen!</Text>
      </TouchableOpacity>
    </View>
  )
}

export default NotFoundScreen
